package lab03.test01;

import java.io.*;

public class Test {
    public static void main(String[] args) {
        BufferedWriter writer=null;
        try {
            writer=new BufferedWriter(new FileWriter("D://Hello.txt"));
            writer.write("hhdsjhfkd" );
            writer.newLine();
            writer.write("hdsdiooi");
        } catch (IOException e) {
            e.printStackTrace();
        }
        finally {
            try {
                writer.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        BufferedReader readered=null;
        try {
            readered=new BufferedReader(new FileReader("D://Hello.txt"));
            String line=" ";
            while ((line=readered.readLine())!=null){

                System.out.println(line);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        finally {
            try {
                readered.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
